package com.xiaodu.acer.phoneplay.ui.fragment;


import android.support.v7.widget.RecyclerView;

import com.xiaodu.acer.phoneplay.bean.AppInfo;
import com.xiaodu.acer.phoneplay.ui.adapter.AppInfoAdapter;

import java.util.List;

/**
 * 升级页面
 */
public class UpgradeAppFragment extends AppManagerFragment {


    AppInfoAdapter mAdapter;


    public UpgradeAppFragment() {
        // Required empty public constructor
    }


    @Override
    public void init() {
        super.init();
        mPresenter.getUpdateApps();
    }

    @Override
    protected RecyclerView.Adapter setupAdapter() {

        mAdapter = AppInfoAdapter.builder()
                .updateStatus(true)
                .rxDownload(mPresenter.getRxDowanload())
                .build();

        return mAdapter;
    }


    @Override
    public void showUpdateApps(List<AppInfo> appInfos) {

        mAdapter.addData(appInfos);
    }
}
